


import requests
class TestReq:
    def test_one(self):
        r = requests.post("https://httpbin.ceshiren.com/post")
        print(r)
        assert r.status_code == 200
    def test_two(self):
        try:
            #使用timeout做超时
            r = requests.post("https://github.com/post",timeout=5)
            assert r.status_code == 200
        except requests.exceptions.Timeout:
            print("请求超时")
            return
    def test_tree(self):
        r = requests.post("https://httpbin.ceshiren.com/post")
        print(r)
        assert r.status_code == 200